import configparser

# 创建配置解析器对象
config = configparser.ConfigParser()
# 读取配置文件
config.read('appConfig.cnf')
# 获取general配置节中的log_level值，这里保持为字符串
WEN_YAN_YI_XIN_API_KEY = config.get('wyyx_app', 'WEN_YAN_YI_XIN_API_KEY')
WEN_YAN_YI_XIN_SECRET_KEY = config.get('wyyx_app', 'WEN_YAN_YI_XIN_SECRET_KEY')


class app_config:

    def __init__(self,name):
        if name=='wyyx_app':
            print('进入配置', name)
            key = config.get(name, 'WEN_YAN_YI_XIN_API_KEY')
            print('key',key)
            self.API_KEY = config.get(name, 'WEN_YAN_YI_XIN_API_KEY')
            self.SECRET_KEY = config.get(name, 'WEN_YAN_YI_XIN_SECRET_KEY')
        else:
            self.API_KEY = ''
            self.SECRET_KEY = ''


    def getKey(self):
        return config.get(name, 'WEN_YAN_YI_XIN_API_KEY')